package com.syqc.monitor.ui.alarm

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.syqc.comlib.utils.loadStringDImgError
import com.syqc.entity.AlarmCount
import com.syqc.monitor.R

/**
 *@author joker
 *@time   2023/12/28 15:30
 *@desc
 */
class AlarmTypeCarAdapter : BaseQuickAdapter<AlarmCount, BaseViewHolder>(R.layout.item_alarm_num) {
    override fun convert(holder: BaseViewHolder, item: AlarmCount) {
        item.run {
            holder.setText(R.id.tv_item_title, alarmName)
                .setText(R.id.tv_item_num, alarmNum.toString())
            holder.getView<ImageView>(R.id.iv_item_image)
                .loadStringDImgError(context, iconLink, R.mipmap.ic_alarm_dafult)
        }
    }
}